feat: support codex custom tool type#101
Draft
haoshan98 wants to merge 6 commits into
Draft
Conversation
Signed-off-by: haoshan98 <haoshanw@gmail.com>
Signed-off-by: haoshan98 <haoshanw@gmail.com>
Signed-off-by: haoshan98 <haoshanw@gmail.com>
Signed-off-by: haoshan98 <haoshanw@gmail.com> # Conflicts: # crates/agentic-server/src/handler/websocket/responses.rs # crates/agentic-server/tests/responses_websocket_test.rs
maralbahari
reviewed
Jul 16, 2026
| }; | ||
| Ok(Self { | ||
| id, | ||
| status: Some("in_progress".to_owned()), |
Collaborator
There was a problem hiding this comment.
you can use MessageStatus enum.
| /// Skipped when empty so vLLM does not receive an empty array. | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub tools: Option<Vec<FunctionTool>>, | ||
| pub tools: Option<Vec<Value>>, |
Collaborator
There was a problem hiding this comment.
this type change from FunctionTool to Value seems like messing up most of the current tool contract. revisit this I think even the free form should be normalized to FunctionTool type
maralbahari
reviewed
Jul 16, 2026
| item.input = input; | ||
| } | ||
| if item.status.as_deref().is_none_or(|status| status == "in_progress") { | ||
| item.status = Some("completed".to_owned()); |
Collaborator
There was a problem hiding this comment.
instead of using the hardcoded string for status. you can use the MessageStatus enum. see the above inflight items how they use it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codex declares freeform tools such as
apply_patchwithtype: "custom". Unlike function tools, these declarations caninclude an opaque grammar, and their calls carry raw text in
inputrather than JSON inarguments. The typed Responsespath previously could not preserve that protocol through upstream inference, streaming, storage, and continuation.
custom_tool_callitems, andcustom_tool_call_outputresults while preserving unknown format fields.generate: falsestartup prewarm requests locally, persist their prompt and tool context, and avoid unnecessary upstream inference.apply_patchremainsavailable after the ordinary model cache expires.
gateway WebSocket, OpenAI HTTPS/SSE, and OpenAI WebSocket recordings that preserve raw input and
custom_tool_call_output.codex exec, and interactive Codex verification workflows.